package com.gdust.hzx.user.controller;

import com.gdust.hzx.user.service.SmsService;
import com.gdust.hzx.model.vo.common.Result;
import com.gdust.hzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: SmsController
 * Package: com.gdust.hzx.user.controller
 * Description:信息服务类控制层
 *
 * @Author syun
 * @Create 2024/12/26 20:46
 * @Version 1.0
 */
@Tag(name = "信息服务接口")
@RestController
@RequestMapping("/api/user/sms")
public class SmsController {
    //注入信息服务类的service
    @Autowired
    private SmsService smsService;

    /**
     * 发送手机验证码接口
     * @param phone 手机号
     * @return
     */
    @Operation(summary="发送手机验证码")
    @GetMapping(value = "/sendCode/{phone}")
    public Result sendCode(@PathVariable String phone){
        //自定义方法：发送手机验证码
        smsService.sendCode(phone);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }


}
